<%@ page import="java.io.StringWriter" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page isErrorPage="true" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>错误详情 - 开发环境</title>
</head>
<body>
<h1>⚠️ 出错了！</h1>
<h2>状态码: ${statusCode}</h2>
<h3>信息: ${errorMessage}</h3>

<h4>异常堆栈跟踪:</h4>
<pre>
    <%
        if (exception != null) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            exception.printStackTrace(pw);
            out.print(sw.toString());
        }
    %>
</pre>

<h4>请求URI: ${pageContext.errorData.requestURI}</h4>
<h4>Servlet名称: ${pageContext.errorData.servletName}</h4>
</body>
</html>